<include file="__THEME__/_header" />
<div id="body_page" name='body_page'>
    <div id="body-bg">
    <div id="header" name="header">
    	{* 未登录时 *}
    	<nosession name="mid">
		<div class="header-wrap">
        	<div class="head-bd">
                <!-- logo -->
                <div class="reg">
                    <a href="{:U('public/Register')}">{:L('PUBLIC_REGISTER')}</a>
                    <i class="vline"> | </i>
                    <a href="{:U('public/Passport/login')}">{:L('PUBLIC_LOGIN')}</a>
                </div>
                <div class="logo" <php>if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE 6.0') !== false):</php>style="_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$site.logo}', sizingMethod='crop');_background:none;"<php>else:</php>style="background:url({$site.logo}) no-repeat;"<php>endif;</php>><a href="{:SITE_URL}"></a></div>
                <!-- logo -->
            </div>
		</div>
		</nosession>

		{* 登录后 *}
		<session name="mid">
        <div class="header-wrap">
        	<div class="head-bd">
                <!-- logo -->
                <div class="logo" <php>if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE 6.0') !== false):</php>style="_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$site.logo}', sizingMethod='crop');_background:none;"<php>else:</php>style="background:url({$site.logo}) no-repeat;"<php>endif;</php>>
                    <a href="{:SITE_URL}"></a>
                </div>
                <!-- logo -->
                <php>if($user['is_init'] == 1):</php>
                <div class="nav">
                    <ul>
                        <volist name='site_top_nav' id='st'>
                          <li <php> if(APP_NAME == $st['app_name'] || $_GET['page'] == $st['app_name']):</php> class="current" <php>endif;</php> ><a href="{$st.url}" target="{$st.target}" class="app">{$st.navi_name}</a>
                            <if condition="isset($st['child'])">
                            <div model-node="drop_menu_list" class="dropmenu" style="width:100px;display:none;">
                                <dl class="acc-list" >
                                    <volist name="st.child" id="stc">
                                    <dd><a href="{$stc.url}" target="{$stc.target}">{$stc.navi_name|getShort=6}</a></dd>
                                    </volist>
                                </dl>
                            </div>
                            </if>
                          </li>                           
                        </volist>
                        <li style="*z-index:100;">
                        <a href="###" class="app">应用</a>
                        <div model-node="drop_menu_list" class="dropmenu" style="width:370px;left:-50px;display:none;z-index:100;">
                            <ul class="acc-list app-list clearfix">
                                <volist name="site_nav_apps" id="li">
                                <li><a href="{:U($li['app_name'])}"><img src="<php>echo empty($li['icon_url_large']) ? APPS_URL.'/'.$li['app_name'].'/Appinfo/icon_app_large.png':$li['icon_url_large'];</php>" width="50" height="50" />{$li.app_alias|getShort=4}</a></li>
                                </volist>
                                <li><a href="{:U('public/App/addapp')}"><img src="__THEME__/image/more.png" width="50" height="50" />更多应用</a></li>
                            </ul>
                        </div>
                        </li>
                    </ul>
                </div>
                <php>endif;</php>
                 <eq name='user.is_init' value='0'>
                  <div class="person">
                    <ul>
                        <li model-node="person" class="dorp-right"><a href="javascript:void(0);" class="app name" style="cursor:default">欢迎，{$user['uname']}</a></li>
                        <li class="dorp-right"><a href="{:U('public/Passport/logout')}" class="app name">退出</a></li>
                    </ul>
                  </div>
                <else />
                <div class="search">
                    <div id="mod-search" model-node="drop_search">
                    <form name="search_feed" id="search_feed" method="get" action="{:U('public/Search/index')}">
                        <input name="app" value="public" type="hidden"/>
                        <input name="mod" value="Search" type="hidden"/>
                        <input type="hidden" name="t" value="2"/>
                        <input type="hidden" name="a" value="public"/>
                        <dl>
                            <dt class="clearfix"><input id="search_input" class="s-txt left"  type="text" value="搜微博 / 昵称 / 标签" onfocus="this.value=''" onblur="setTimeout(function(){ $('#search-box').remove();} , 200);if(this.value=='') this.value='搜微博 / 昵称 / 标签';" event-node="searchKey" name='k'  autocomplete="off"><a href="javascript:void(0)" class="ico-search left" onclick="if(getLength($('#search_input').val()) && $('#search_input').val()!=='搜微博 / 昵称 / 标签'){ $('#search_feed').submit(); return false;}"></a>
                            </dt>
                        </dl>
                    </form>
                    </div>
                </div> 
                <div class="person">
                    <ul>
                        <li model-node="person" class="dorp-right">
                            <a href="{$user['space_url']}" class="username">{$user['uname']|getShort=6}</a>
                        </li>                       
                        <li model-node="notice" class="dorp-right"><a href="javascript:void(0);" class="app">{:L('PUBLIC_MESSAGE')}</a>
                            <div  class="dropmenu" model-node="drop_menu_list">
                            	<ul class="message_list_container message_list_new"  style="display:none">
                                    <li rel="new_folower_count" style="display:none">
                                        <span></span>，<a href="{:U('public/Index/follower',array('uid'=>$mid))}">{:L('PUBLIC_FOLLOWERS_REMIND')}</a></li>
                                    <li rel="unread_comment" style="display:none"><span></span>，<a href="{:U('public/Comment/index',array('type'=>'receive'))}">
                                        {:L('PUBLIS_MESSAGE_REMIND')}</a></li>
                                    <li rel="unread_message" style="display:none"><span></span>，<a href="{:U('public/Message')}" >{:L('PUBLIS_MESSAGE_REMIND')}</a></li>
                                    <li rel="unread_atme" style="display:none"><span></span>，<a href="{:U('public/Mention')}">{:L('PUBLIS_MESSAGE_REMIND')}</a></li>
                                    <li rel="unread_notify" style="display:none"><span></span>，<a href="{:U('public/Message/notify')}">{:L('PUBLIS_MESSAGE_REMIND')}</a></li>
                                </ul>
                                <dl class="acc-list W-message" >
                                    <dd><a  href="{:U('public/Mention/index')}">@提到我的</a></dd>
                                    <dd><a  href="{:U('public/Comment/index', array('type'=>'receive'))}">收到的评论</a></dd>
                                    <dd><a  href="{:U('public/Comment/index', array('type'=>'send'))}">发出的评论</a></dd>
                                    <dd><a  href="{:U('public/Message/index')}">我的私信</a></dd>
                                    <dd><a  href="{:U('public/Message/notify')}">系统消息</a></dd>
                                    <php>if(CheckPermission('core_normal','send_message')){</php>
                                <dd class="border"><a event-node="postMsg" href="javascript:void(0)" onclick="ui.sendmessage()">{:L('PUBLIC_SEND_PRIVATE_MESSAGE')}&raquo;</a></dd>
                                <php>}</php>
                                </dl>
                            </div>
                        </li>
                        <li model-node="account" class="dorp-right"><a href="javascript:void(0);" class="app">{:L('PUBLIC_ACCOUNT')}</a>
                            <div model-node="drop_menu_list" class="dropmenu" style="width:100px">
                                <dl class="acc-list">
                                <dd><a href="{:U('public/Account/index')}">{:L('PUBLIC_SETTING')}</a></dd>
                                
                                <php>if(CheckTaskSwitch()):</php>
                                <dd><a href="{:U('public/Task/index')}">任务中心</a></dd>
                                <dd><a href="{:U('public/Medal/index')}">勋章馆</a></dd>
                                <php>endif;</php>
                                
                                <dd><a href="{:U('public/Rank/index','type=2')}">排行榜</a></dd>
                                <php>if(isInvite() && CheckPermission('core_normal','invite_user')):</php>
                                <dd><a href="{:U('public/Invite/invite')}">{:L('PUBLIC_INVITE_COLLEAGUE')}</a></dd>
                                <php>endif;</php>
                                <php>if(CheckPermission('core_admin','admin_login')){</php>
                                <dd><a href="{:U('admin')}">{:L('PUBLIC_SYSTEM_MANAGEMENT')}</a></dd>
                                <php>}</php>

                                <dd class="border"><a href="{:U('public/Passport/logout')}">{:L('PUBLIC_LOGOUT')}&raquo;</a></dd>
                                <dd></dd>
                                </dl>
                            </div>
                        </li>
                    </ul>
                </div>        
                <php> if(MODULE_NAME !='Register'):</php>
                <div id="message_container" class="layer-massage-box" style="display:none">
                	<ul class="message_list_container" >
                        <li rel="new_folower_count" style="display:none"><span></span>，<a href="{:U('public/Index/follower',array('uid'=>$mid))}">{:L('PUBLIC_FOLLOWERS_REMIND')}</a></li>
                		<li rel="unread_comment" style="display:none"><span></span>，<a href="{:U('public/Comment/index',array('type'=>'receive'))}">{:L('PUBLIS_MESSAGE_REMIND')}</a></li>
                        <li rel="unread_message" style="display:none"><span></span>，<a href="{:U('public/Message')}" >{:L('PUBLIS_MESSAGE_REMIND')}</a></li>
 	                    <li rel="unread_atme" style="display:none"><span></span>，<a href="{:U('public/Mention')}">{:L('PUBLIS_MESSAGE_REMIND')}</a></li>
     	                <li rel="unread_notify" style="display:none"><span></span>，<a href="{:U('public/Message/notify')}">{:L('PUBLIS_MESSAGE_REMIND')}</a></li>
                	</ul>
                <a href="javascript:void(0)" onclick="core.dropnotify.closeParentObj()" class="ico-close1"></a>
                </div>
                <php>endif;</php>
                </eq>
        	</div>
        </div>
        <php>if(MODULE_NAME != 'Search'):</php>
        <div id="search"  class="mod-at-wrap search_footer" model-node='search_footer' style="display:none;z-index:-1">
            <div class="search-wrap">
                <div class="input">
                     <form id="search_form" action="{:U('public/Search/index')}" method="GET">
                        <div class="search-menu" model-node='search_menu' model-args='a={$curApp}&t={$curType}'>
                            <a href="javascript:;" id='search_cur_menu'>{$curTypeName|default="全站"}<i class="ico-more"></i></a>
                        </div>
                        <input name="app" value="public" type="hidden" />
                        <input name="mod" value="Search" type="hidden" />
                        <input name="a" value="{$curApp}" id='search_a' type="hidden"/>
                        <input name="t" value="{$curType}" id='search_t' type="hidden"/>
                        <input name="k" value="{$_GET['k']|t}" type="text" class="s-txt" onblur="this.className='s-txt'" onfocus="this.className='s-txt-focus'" autocomplete="off">
                        <a class="btn-red left" href="javascript:void(0);" onclick="$('#search_form').submit();"><span class="ico-search"></span></a>
                    </form>
                </div>
            </div>
        </div>
        <div class="mod-at-wrap" id="search_menu" ison='no' style="display:none" model-node="search_menu_ul">
        <div class="mod-at">
            <div class="mod-at-list">
                <ul class="at-user-list">
                    <li onclick="core.search.doShowCurMenu(this)" a='public' t='' typename='{:L('PUBLIC_ALL_WEBSITE')}'>{:L('PUBLIC_ALL_WEBSITE')}</li>
                <volist name='menuList' id='m'>
                    <php>
                        if($m['app_name'] == $curApp && $m['type_id'] == $curType){
                            $curTypeName = $m['type'];
                        }
                    </php>
                    <li onclick="core.search.doShowCurMenu(this)" a='{$m.app_name}' t='{$m.type_id}' typename='{$m.type}'>{$m.type}</li>
                </volist>   
                </ul>
            </div>
        </div>
        </div>
       <php>endif;</php> 
    <script type="text/javascript">
    $(document).ready(function(){
        $("#mod-product dd").hover(function() {
            $(this).addClass("hover");
        }, function() {
            $(this).removeClass("hover");
        });
        core.plugInit('search');
    });

    core.plugFunc('dropnotify',function(){
        setTimeout(function(){
            core.dropnotify.init('message_list_container','message_container');
        },320);   
    });

    </script>
		</session>
    </div>
<php>
//出现注册提示的页面
$show_register_tips = array('public/Profile','public/Topic','weiba/Index');
if(!$mid && in_array(APP_NAME.'/'.MODULE_NAME,$show_register_tips)){
</php>
<php>$registerConf = model('Xdata')->get('admin_Config:register');</php>
<!--未登录前-->
<div class="login-no-bg clearfix">
  <div class="login-no-box">
    <div class="left">
        <dl class="clearfix left">
            <dt><img src="__THEME__/image/smiling-face.jpg" /></dt>
            <dd><p>欢迎来到{$site.site_name}，</p><p>赶紧注册与朋友们分享快乐点滴吧！</p></dd>
        </dl>
        <php>if($registerConf['register_type'] == 'open'){</php>
        <a href="{:U('public/Register/index')}" class="btn-reg">立即注册</a>
    	<php>}</php>
    </div>
    <div class="right">
        <p>已有帐号？<a href="javascript:quickLogin()">立即登录</a></p>
    </div>
  </div>
</div>
<php>}</php>